unit Map_K1;

interface

uses
  SysUtils, Classes, ADODB, DataEngine, Class_K1;

type
  TMap_K1 = class(TDataEngine)
  public
    function ReadDS(AADODst: TADODataSet): TBaseClass; override;
    function GetStrsIndex(ABaseClass: TBaseClass): string; override;

    function GetStrInsert: string; override;
    function GetStrUpdate: string; override;
    function GetStrDelete: string; override;
    procedure SetParameters(ABaseClass: TBaseClass); override;

    function GetK1(CodeA: string; K1StrsListA: TStringList): TK1;
  end;

implementation

{ TMap_K1 }

function TMap_K1.GetK1(CodeA: string; K1StrsListA: TStringList): TK1;
var
  I: Integer;
begin
  Result := nil; 
  if CodeA = '' then Exit;
  for I := 0 to K1StrsListA.Count - 1 do
  begin
    if TK1(K1StrsListA.Objects[I]).BM = CodeA then
    begin
      Result := TK1(K1StrsListA.Objects[I]);
      Exit;
    end;
  end;
end;

function TMap_K1.GetStrDelete: string;
begin
  Result := '';
end;

function TMap_K1.GetStrInsert: string;
begin
  Result := '';
end;

function TMap_K1.GetStrsIndex(ABaseClass: TBaseClass): string;
begin
  Result := '';
end;

function TMap_K1.GetStrUpdate: string;
begin
  Result := '';
end;

function TMap_K1.ReadDS(AADODst: TADODataSet): TBaseClass;
begin
  Result := TK1.Create;
  with TK1(Result) do
  begin
    BM := AADODst.FieldByName('BM').AsString;
    MC := AADODst.FieldByName('MC').AsString;
    JC := AADODst.FieldByName('JC').AsString;
    YNXJ := AADODst.FieldByName('YNXJ').AsString;
  end;
end;

procedure TMap_K1.SetParameters(ABaseClass: TBaseClass);
begin
  inherited;

end;

end.
